/**
 * create by Allan on 09/13/2017
 */
import { createAction } from "redux-actions";
import fetch from "../../utils/fetch.js";

export const getPendingLeave = createAction("PENDING_LEAVE");
export const fetchPendingLeave = param => () =>
  fetch(`/hrmregister/mobile/empList/getAllPreDimissionEmpList`, {
    body: param,
    meta: {
      dipId: 66546
    }
  });
// .then(res => {
//   if (res.success) {
//     dispatch(getPendingLeave(res.result));
//   }
//   return res;
// });

/**
 * 删除
 * @param userId get
 */
export const deleteList = userId => () =>
  fetch("/hrmregister/mobile/empList/deletePreDimissiondEmp", {
    method: "GET",
    params: {
      userId
    },
    meta: {
      dipId: 8433
    }
  });
